<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" type="text/css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/reg.css" type="text/css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/base.css" type="text/css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/headbott.css" type="text/css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/index.css" type="text/css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/ly-list.css" type="text/css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/reg.css" type="text/css"/>
    
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js" ></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/project/address.js"></script>
	
    <title>众筹</title>
    
    <script type="text/javascript">
    function saveDraft() {
    	var address = $("#province").val() + "#" + $("#city").val();
    	$("#address").val(address);
    	console.log(address);
    	
    	var form = new FormData(document.getElementById("projectinfoForm"));
	    $.ajax({
			url : "${pageContext.request.contextPath}/projects/front/projectinfo/savedraft.action",
			method : "post",
			dataType : "json",
			data:  form,
			//async : true,
			processData:false,
            contentType:false,
			success : function(data) {
				alert("======" + data.msg);
			},
			error : function() {
				alert("保存草稿失败！！！");
			}
		})
    }
    </script>
</head>
<body>
<!--上部导航栏开始-->
<%@include file="/WEB-INF/pages/front/common/cf_head.jsp" %>
<!--上不导航栏结束-->
<!--中间核心-->
<div class="product">
    <!--头上表格-->
    <%@include file="/WEB-INF/pages/front/common/cf_project_publish_head.jsp" %>
    <!--下部foem表单-->
    <div class="product-form">
        <!--上标题-->
        <div class="product-title">
            <div class="my-h4">
                <h4>创建你的项目信息</h4>
            </div>
            <div class="btn-save">
                <button class="btn btn-default" id="saveDraft" onClick="saveDraft()">保存草稿</button>
            </div>

        </div>
        <div class="clear"></div>
        <hr>
        <!--表单-->
        <form id="projectinfoForm" action="#" method="post" enctype="multipart/form-data">
            <div class="my-form">
                <div class="product-info-input">
                    <b>设置封面：</b>
                    <input type="file" name="photo" >
                </div>
                <div class="product-info-input"><b>项目标题：</b>
                	<input class="text" type="text" name="title" id="title" placeholder="给自己的项目起个漂亮的名字吧">
                </div>
                <div class="product-info-input"><b>筹款目的：</b><div class="text-area">
                	<textarea name="fundRaisingPurposes" rows="2" placeholder="一句话介绍一下你的项目吧"></textarea></div>
                </div>
                <div class="product-info-select">
                    <div class="product-info-text">
                    <input type="hidden" name="address" id="address" />
                    <b>项目地点：</b>
                    </div>
                    <div class="product-info-select1">
                        <select class="info-select1" name="province" id="province" onchange="getCity(this.value)">
                            <option>请选择</option>
                        </select>
                    </div>
                    <div class="product-info-select2">
                        <select class="info-select2" name="city" id="city">
                            <option>请选择</option>
                        </select>
                    </div>
                </div>

                <div class="product-info-input"><b>筹资金额：</b>
                	<input name="money" class="text" type="text" placeholder="输入你需要的金额，最少500元">元
                </div>
                <div class="product-info-input"><b>筹资天数：</b>
                <input name="days" class="text" type="text" placeholder="">天
                </div>
            </div>
        </form>
    </div>
</div>
<!--底部开始-->
<%@include file="/WEB-INF/pages/front/common/cf_bottom_2.jsp" %>
</body>
</html>    